/**
 * user 列表页
 */
Ext.define("app.view.demo.UserList", {
    extend: "app.components.ui.list.List",
    alias: "widget.userlist_",
    title: "用户列表",
    id: "userList",

    initComponent: function () {
        this.extStore = "demo.Users";
        this.pageSizeList=[1,2,5];
        this.extColumns = [
            {text: "Name", dataIndex: "name"},
            {text: "Email", dataIndex: "email", flex: 1},
            {text: "Phone", dataIndex: "phone"}
        ];
        this.extQuery = [
            {
                columnWidth: 0.3,
                fieldLabel: "Field 1",
                name: "field1",
                xtype: 'combogrid_',
                store: Ext.create("app.store.demo.CodeValues"),
                minPickerWidth: 450,
                minPickerHeight: 300,
                displayField: "请选择",
                columns: [
                    {text: "代码", dataIndex: "value"},
                    {text: "名称", dataIndex: "text", flex: 1},
                ],
                valueLabel: "代码",
                nameLabel: "名称",
                listeners: {
                    select: function (v, r) {
                        var form = this.up('form').getForm();
                        form.findField("field2").setValue(r.data.text);
                    }
                }
            }, {
                columnWidth: 0.5,
                fieldLabel: "Field 2",
                name: "field2"
            }
        ];
        this.callParent();
    },
});
